<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <p>{{c}}</p>
      <p>{{bigC}}</p>

      <!-- 点击async+按钮,让c立刻变化,但是bigC在2s后变化 -->
      <button @click="c++">async+</button>
    </div>

    <script src="./vue.js"></script>

    <script>
      const vm = new Vue({
        el: '#app',
        data: {
          c: 1,
          bigC: 1,
        },
        watch: {
          c() {
            setTimeout(() => (this.bigC = this.c * 10), 2000)
          },
        },
      })
    </script>
  </body>
</html>
